begintownscript;

variables;

int choice;

body;

beginstate INIT_STATE;
	set_name(6,"Kiersten");
	
	set_name(20,"Demetrius");
	set_level(20,12);
	
	turn_off_training(1);
break;

beginstate EXIT_STATE;
break;

beginstate START_STATE;
break;

beginstate 10;
	if (get_flag(3,3) == 0) {
		if (is_combat() == 1) {
			block_entry(1);
			end(); }
		move_to_new_town(2,18,24); }
	if (get_flag(3,3) == 1) {
		reset_dialog();
		add_dialog_str(0,"When you come back into Xerch'de's home, the guards are back. They come in and question you. After telling them what happened, they rush off to tell Ariel.",0);
		add_dialog_str(1,"Ariel, very annoyed, comes at once, but only proceeds to yell for evidence. You give him the key that Kiersten has dropped.",0);
		add_dialog_str(2,"When they try the key on the trapdoor, it works. Reluctantly, Ariel gives you a thousand gold for killing those who were responsible for Xerch'de's death.",0);
		add_dialog_str(3,"The End.",0);
		add_dialog_choice(0,"Yay! Money!");
		choice = run_dialog(1);
		if (choice == 1) {
			change_coins(1000);
			change_spec_item(0,-1);
			end_scenario(1); } }
break;

beginstate 11;
	if (get_flag(3,1) == 0 && get_flag(5,1) == 3) {
		reset_dialog();
		add_dialog_str(0,"When you walk into the room, you are surprised that no one takes a swing at you. In the room, there are a selection of guards, and a priest donned in blue-black robes. The priest speaks.",0);
		add_dialog_str(1,"_My name is Kiersten. I am not surprised that someone has found this place, although I had heard that a band of adventurers had been thrown in jail._",0);
		add_dialog_str(2,"You tell her about Demetrius. _Demetrius let you out, eh? I should've known he would've gone against me. He never really liked what I was doing._",0);
		add_dialog_str(3,"_See, under Ariel Tarik, among many others, we have been able to get away with... things that normally we couldn't. But with Xerch'de coming in with his so-called, 'better rule'...sadly, we can't._",0);
		add_dialog_str(4,"_And now, with Xerch'de out of the way, we can do as we please...if you don't get in the way first._",0);
		add_dialog_choice(0,"You won't get away with it!");
		choice = run_dialog(1);
		if (choice == 1) {
			set_state_continue(12); }
		}
	if (get_flag(3,1) == 0 && get_flag(5,1) == 2) {
		reset_dialog();
		add_dialog_str(0,"When you walk into the room, you are surprised that no one takes a swing at you. In the room, there are a selection of guards, and a priest donned in blue-black robes. The priest speaks.",0);
		add_dialog_str(1,"_My name is Kiersten. I am not surprised that someone has found this place. Although, why it was you who came is oblivious to me. I thought that maybe someone would send at least some guards..._",0);
		add_dialog_str(2,"You tell her about Demetrius. _Demetrius told you to kill me? I should've known he would've gone against me. He never really liked what I was doing._",0);
		add_dialog_str(3,"_See, under Ariel Tarik, among many others, we have been able to get away with... things that normally we couldn't. But with Xerch'de coming in with his so-called, 'better rule'...sadly, we can't._",0);
		add_dialog_str(4,"_And now, with Xerch'de out of the way, we can do as we please...if you don't get in the way first._",0);
		add_dialog_choice(0,"You won't get away with it!");
		choice = run_dialog(1);
		if (choice == 1) {
			set_state_continue(12); }
		}
break;

beginstate 12;
	set_total_visibility(1);
	put_boom_on_space(12,14,2,0);
	activate_hidden_group(1);
	force_instant_terrain_redraw();
	run_animation_sound(10);
	pause(5);
	
	message_dialog("Just now, Demetrius has teleported into the room. Kiersten speaks again. _Demetrius! How nice of you to join us! Now I can have the pleasure of killing you, too!_","");
	set_flag(3,1,1);
	set_attitude(11,10);
	set_attitude(12,10);
	set_attitude(18,10);
	set_attitude(19,10);
	set_attitude(10,10);
	set_attitude(9,10);
	set_attitude(6,10);
	set_attitude(41,10);
	set_attitude(42,10);
	set_attitude(43,10);
	set_total_visibility(0);
	force_instant_terrain_redraw();
	end();
break;

beginstate 13;	
break;

beginstate 14;
	if (get_flag(3,15) == 0) {
	message_dialog("You open the first door the come across a small kitchen. The only other door you see on the right wall. The leader should be behind that door.","");
	set_flag(3,15,1); }
break;

beginstate 15;
	if (get_flag(3,20) == 0) {
	message_dialog("You reach the room, only to find that it is a small barrack. The leader must be somewhere else...","");
	set_flag(3,20,1); }
break;